<template>
  <div class="essay-question-container">
    <div class="question">
      <!-- <span>{{ topic.order }}.&nbsp;</span> -->
      问题：
      <edit-block :content="topic.title" :blockType="`title`"></edit-block>
    </div>
    <el-input
      type="textarea"
      :rows="8"
      placeholder="请输入内容"
      v-model="answer"
      resize="none"
    >
    </el-input>
    <explain-edit-block :explain="topic.explain"></explain-edit-block>
  </div>
</template>

<script>
import ExplainEditBlock from "@/components/ExplainEditBlock.vue";
import EditBlock from "../EditBlock.vue";
import { mixin } from "@/mixin";
// 问答题
export default {
  components: { EditBlock, ExplainEditBlock },
  mixins: [mixin],
  data() {
    return {
      topicTemplate: {
        title: "why 1+1 =2",
        answer: "",
        explain: "默认解释",
      },
      questionType: "an",
      answer:""
    };
  },
  watch:{
    answer(v){
      this.$store.commit("topicAbout/SET_CORRECT", v);
    }
  }
};
</script>

<style lang='less' scoped>
.essay-question-container {
  width: 100%;
  height: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  .question {
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
  }
}
</style>